home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 38 / Amiga Format CD38 (1999-03-15)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-04].iso / -seriously_amiga- / misc / ced_html / html / html_table_header.ced < prev    next >
Text File  |  1999-01-25  |  4KB  |  149 lines

  1. /*
  2. ** html_table_header.ced
  3. **
  4. ** $VER: html_table_header.ced 1.1 (12.07.1998)
  5. **
  6. ** Arexx script for HTML v3.2 table header cell options
  7. **
  8. ** This script works with CygnusEd Professional v4.2
  9. **
  10. ** Copyright © Eric BELLE
  11. */
  12.  
  13. /*
  14. **------------------------------------------------------------------------------
  15. **    Initialisation
  16. **------------------------------------------------------------------------------
  17. */
  18.  
  19. OPTIONS RESULTS                            /* Tell CygnusEd to return results. */
  20. NL = '0A'X                                    /* Alias for new line. */
  21. KRETURN = RAWKEY 68                    /* Shortcut to the return key. */
  22. KTAB = RAWKEY 66                        /* Shortcut to the tab key. */
  23. STATUS TABSARESPACES                /* Return TAB mode ("tab" or "space"). */
  24. IF RESULT = 1                                /* Test the TAB mode. */
  25. THEN "TABS = SPACES"                /* Switch TAB mode from "space" to "tab". */
  26. ELSE NOP                                        /* No operation. */
  27. TAB SIZE 1                                    /* Set TAB size proportional to 2 spaces. */
  28.  
  29. /*
  30. **------------------------------------------------------------------------------
  31. **    Horizontal position
  32. **------------------------------------------------------------------------------
  33. */
  34.  
  35. HorizontalPosition = "q"
  36. DO WHILE ~(HorizontalPosition="l" | HorizontalPosition="c" | HorizontalPosition="r",
  37.                     | HorizontalPosition=" " | HorizontalPosition="RESULT")
  38.     GETSTRING "c" '"Horizontal position: (l)eft, (c)enter, (r)ight?"'
  39.     HorizontalPosition = RESULT
  40. END
  41.  
  42. IF (HorizontalPosition="RESULT" | HorizontalPosition=" ")
  43. THEN EXIT 0
  44. ELSE NOP
  45.  
  46. /*
  47. **------------------------------------------------------------------------------
  48. **    Vertical position
  49. **------------------------------------------------------------------------------
  50. */
  51.  
  52. VerticalPosition = "q"
  53. DO WHILE ~(VerticalPosition="t" | VerticalPosition="b" | VerticalPosition="m",
  54.                     | VerticalPosition=" " | VerticalPosition="RESULT")
  55.     GETSTRING "m" '"Vertical position: (t)op, (m)iddle, (b)ottom?"'
  56.     VerticalPosition = RESULT
  57. END
  58.  
  59. IF (VerticalPosition="RESULT" | VerticalPosition=" ")
  60. THEN EXIT 0
  61. ELSE NOP
  62.  
  63. /*
  64. **------------------------------------------------------------------------------
  65. **    Cell color
  66. **------------------------------------------------------------------------------
  67. */
  68.  
  69. GETSTRING "#7070FF" '"Cell color (#RGB)?"'
  70. CellColor = RESULT
  71.  
  72. IF (CellColor="RESULT" | CellColor=" ")
  73. THEN EXIT 0
  74. ELSE NOP
  75.  
  76. /*
  77. **------------------------------------------------------------------------------
  78. **    Cell width
  79. **------------------------------------------------------------------------------
  80. */
  81.  
  82. GETSTRING "100%" '"Cell width (pixels or browser window %)?"'
  83. CellWidth = RESULT
  84.  
  85. IF (CellWidth="RESULT" | CellWidth=" ")
  86. THEN EXIT 0
  87. ELSE NOP
  88.  
  89. /*
  90. **------------------------------------------------------------------------------
  91. **    Cell height
  92. **------------------------------------------------------------------------------
  93. */
  94.  
  95. GETSTRING "100%" '"Cell height (pixels or browser window %)?"'
  96. CellHeight = RESULT
  97.  
  98. IF (CellHeight="RESULT" | CellHeight=" ")
  99. THEN EXIT 0
  100. ELSE NOP
  101.  
  102. /*
  103. **------------------------------------------------------------------------------
  104. **    Html table header cell marks
  105. **------------------------------------------------------------------------------
  106. */
  107.  
  108. SELECT
  109.     WHEN (HorizontalPosition="c") THEN HorizontalPositionString = " ALIGN=CENTER"
  110.     WHEN (HorizontalPosition="l") THEN HorizontalPositionString = " ALIGN=LEFT"
  111.     WHEN (HorizontalPosition="r") THEN HorizontalPositionString = " ALIGN=RIGHT"
  112.     OTHERWISE NOP
  113. END
  114.  
  115. SELECT
  116.     WHEN (VerticalPosition="t") THEN VerticalPositionString = " VALIGN=TOP"
  117.     WHEN (VerticalPosition="m") THEN VerticalPositionString = " VALIGN=MIDDLE"
  118.     WHEN (VerticalPosition="b") THEN VerticalPositionString = " VALIGN=BOTTOM"
  119.     OTHERWISE NOP
  120. END
  121.  
  122. OpenCell = "<TH"
  123. OpenCell = OpenCell || HorizontalPositionString
  124. OpenCell = OpenCell || VerticalPositionString
  125. OpenCell = OpenCell || " WIDTH="        || CellWidth
  126. OpenCell = OpenCell || " HEIGHT="        || CellHeight
  127. OpenCell = OpenCell || " BGCOLOR="    || CellColor        || ">"
  128. CloseCell = "</TH>"
  129.  
  130. /*
  131. **------------------------------------------------------------------------------
  132. **    Html table header cell structure
  133. **------------------------------------------------------------------------------
  134. */
  135.  
  136. TEXT OpenCell
  137. "AUTO-INDENT" ; KTAB
  138. TEXT "Should be modified - Main cell" 
  139. "AUTO-INDENT" ; BACKTAB
  140. TEXT CloseCell
  141.  
  142. /*
  143. **------------------------------------------------------------------------------
  144. **    End of html_table_header.ced Arexx script
  145. **------------------------------------------------------------------------------
  146. */
  147.  
  148. EXIT 0
  149.